
<div class="hide">
	<form action="" method="post" enctype="multipart/form-data">
	<input type="file" name="image" id="up">
	<button>dccc</button>
</form>
</div>

<div class="row" style="background-color:#FFFFFF;border-radius:10px;margin:10px">
	<div class="col-md-3" style="padding-top:50px;padding-left:40px;">
		<img src="{$info['uid']|uidimage}" width="150px" class="img-circle" id="image">
	</div>
	<div class="col-md-6">
		<p>
			<h3>{$info['uid']|uidname} </h3>
		</p>
		<p>
			<b><span class="text-warning">$ {$info['point']}</span></b> / <b><span class="text-info">LEVEL {$info['level']/100|ceil}</span></b> <small class="muted">还需要<?php echo 100-$info['level']%100 ?>经验升级</small>
		</p>
		<p>
			<h4><a href="/index.php/Remind/index"><b class="text-danger">未读消息 </b><span class="label label-danger"><?php echo D('Remind')->num() ?></span></a></h4>
		</p>
		<p>
			<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">个人信息</button>
			<?php sign_button() ?>
		</p>
		<p>
			<button class="btn btn-warning"  data-toggle="modal" data-target="#change">修改密码</button> <a href="/index.php/User/logout" class="btn btn-info">离开</a> <a class="btn btn-default" href="/index.php/Talk/talklist">会话列表</a>
		</p>
		<p>
			<span class="text-warning"> 加入时间：<cite>{$info['time']|date="Y-m-d",###}</cite></span>

			<span class="text-warning"> 最后登入：<cite>{$info['lasttime']|date="Y-m-d",###}</cite></span>
		</p>
		<p>
			<span class="text-warning"> 加入IP：<cite>{$info['joinip']}</cite></span>

			<span class="text-warning"> 最后IP：<cite>{$info['lastip']}</cite></span>

		</p>
		<p>
			<span class="text-warning"> 发帖数：<cite>{$info['pnum']}</cite></span>
			
			<span class="text-warning"> 回贴数：<cite>{$info['rnum']}</cite></span>

		</p>

	</div>
</div>
<div class="row" style="background-color:#FFFFFF;border-radius:10px;margin:10px;padding:10px;">
	<table class="table table-striped" >
		<tr class="info">
			<th  class="text-center">
				<span class="glyphicon glyphicon-th-list"></span> 板块
			</th>
			<th>
				<span class="glyphicon glyphicon-align-justify"></span> 帖子
			</th>
			<th class="text-right">
				<span class="glyphicon glyphicon-time"></span> 发布时间
			</th>
		</tr>
		<volist name="post" id="p">
			<tr>
				<td class="text-center">
					<span class="text-success"><B>{$p['bid']|bidname}</B></span>
				</td>
				<td class="text-left">
					<a href="/index.php/Index/post?pid={$p['pid']}">{$p['title']}</a>
					<a href="/index.php/Post/edit?pid={$p['pid']}"><span class="glyphicon glyphicon-edit"></span></a>
				</td>
				<td class="text-right">
					<a href="/index.php/Post/delpost?pid={$p['pid']}" class="btn btn-danger">删除</a>
					{$p['time']|date="Y-m-d H:i",###}
				</td>
			</tr>
		</volist>
	</table>
</div>
<div class="row text-center">
	<p>{$page}</p>
</div>
<script type="text/javascript">
	$("#image").click(function(){
		$("#up").click();
	})

	$("#up").change(function(){
		file=this.files[0];
		var fd=new FormData();
		fd.append("image",file);
		$.ajax({
			url:"/index.php/User/image",
			type:"POST",
			data:fd,
			processData: false,  // 告诉jQuery不要去处理发送的数据
  			contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
			success:function(data){
				history.go(0);
			}
		})
		
	})

</script>
<?php
	$json=json_decode($info['info'],true);
?>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">个人信息</h4>
      </div>
      <div class="modal-body ">
        <div class="input-group" style="margin:10px">
  			<span class="input-group-addon">邮箱</span>
 			<input type="email" class="form-control"  id="info_email" value={$json['email']}>
		</div>
		<div class="input-group" style="margin:10px">
  			<span class="input-group-addon">出生</span>
 			<input type="date" class="form-control"  id="info_date" value={$json['date']}>
		</div>

		<span class="btn btn-success" style="margin:10px">个人笔记</span>
		<textarea class="form-control" style="height:400px" id="info_text">
			{$json['text']}
		</textarea>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" id="infoc">Save changes</button>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
	$("#infoc").click(function(){
		var email=$("#info_email").val();
		var text=$("#info_text").val();
		var date=$("#info_date").val();
		$.post(
			"/index.php/User/infoc",
			{
				email:email,
				text:text,
				date:date
			},
			function (data){
				history.go(0);
			}

			)



	})

</script>
<div class="modal fade" id="change" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
      	<h4 class="modal-title" >修改密码</h4>
      </div>
      <div class="modal-body">
      	<form method="post" action="/index.php/User/change">
      	<div class="input-group" style="margin:10px">
      		<span class="input-group-addon">
      			旧密码
      		</span>
      		<input type="password" class="form-control" name="password">
      	</div>
      	<div class="input-group" style="margin:10px">
      		<span class="input-group-addon">
      			新密码
      		</span>
      		<input type="password" class="form-control" name="new">
      	</div>
      </div>
      <div class="modal-footer">
      	<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      	<button class="btn btn-danger">修改</button>
      	</form>
      </div>
    </div>
  </div>
</div>